home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / ums / ums-beta / developer / oberon / ums.mod
Text File  |  1995-04-04  |  28KB  |  662 lines

  1. (*(* ------------------------------------------------------------------------
  2.   :Program.       ums
  3.   :Contents.      interface for ums.library
  4.   :Author.        Martin Horneffer [mh]
  5.   :Address.       Snail Mail:              EMail:
  6.   :Address.       Warmweiherstraße 18      UUCP: mh@umshq.adsp.sub.org
  7.   :Address.       D-52066 Aachen           FIDO: 2:242/7.9   MAUS: AC2
  8.   :Address.       GERMANY                  INet: mh@umshq.dfv.rwth-aachen.de
  9.   :Remark.        $Id: ums.mod,v 1.15 1995/04/04 19:07:56 mh Exp mh $
  10.   :Update.        $Log: ums.mod,v $
  11.   :Update.        Revision 1.15  1995/04/04  19:07:56  mh
  12.   :Update.        new tags SelMaxCount, SelMaxSize.
  13.   :Update.
  14.   :Update.        Revision 1.14  1995/03/24  22:33:17  mh
  15.   :Update.        new error numbers.
  16.   :Update.
  17.   :Update.        Revision 1.13  1995/02/24  18:25:30  mh
  18.   :Update.        new tagSelSize.
  19.   :Update.
  20.   :Update.        Revision 1.12  1994/09/01  10:10:49  mh
  21.   :Update.        new tags for ReadConfig() WriteConfig()
  22.   :Update.
  23.   :Update.        Revision 1.11  1994/04/30  14:05:13  mh
  24.   :Update.        *** empty log message ***
  25.   :Update.
  26.   :Update.        Revision 1.10  1994/04/30  14:03:28  mh
  27.   :Update.        Tags for MatchConfig()
  28.   :Update.
  29.   :Update.        Revision 1.9  1994/04/29  00:29:16  mh
  30.   :Update.        tagCfgLockVar, tagCfgUnlockVar
  31.   :Update.
  32.   :Update.        Revision 1.8  1994/04/24  19:58:40  mh
  33.   :Update.        V11 (meeting)
  34.   :Update.
  35.   :Language.      Oberon
  36.   :Translator.    Amiga Oberon V3.11d
  37. ------------------------------------------------------------------------ *)*)
  38. MODULE ums;
  39.  
  40. IMPORT Utility, Exec, Intuition, SYSTEM;
  41.  
  42. CONST
  43.   libName*    = "ums.library";
  44.   libVersion* = 11;
  45.  
  46. VAR
  47.   base*  : Exec.LibraryPtr;
  48.  
  49. TYPE
  50.   Account*  = LONGINT;
  51.   MsgNum*   = LONGINT;
  52.   Error*    = INTEGER;
  53.  
  54. CONST
  55.   NumFields*    = 128;
  56.  
  57. TYPE
  58.   APTR*         = Exec.APTR;
  59.   STRPTR*       = Exec.LSTRPTR;
  60.  
  61.   MsgTextFields* = ARRAY NumFields OF STRPTR;
  62.  
  63.   MessageInfo*  = STRUCT
  64.                     hdrLen-     : LONGINT;
  65.                     txtLen-     : LONGINT;
  66.                     date-       : LONGINT;
  67.                     up-, dn-,
  68.                     lt-, rt-    : MsgNum;
  69.                     globalStat- : LONGSET;
  70.                     userStat-   : LONGSET;
  71.                     loginStat-  : LONGSET;
  72.                     hardLink-   : MsgNum;
  73.                     softLink-   : MsgNum;
  74.                     (* V11 extension, only filled by tagRExtMsgInfo *)
  75.                     cDate-      : LONGINT;
  76.                     reserved    : ARRAY 3 OF LONGINT;
  77.                   END;
  78.  
  79. CONST
  80.    (* actions for ServerControl() *)
  81.  
  82.    CleanUp*   = 1;
  83.    Flush*     = 2;
  84.    Quit*      = 3;
  85.    QuitForce* = 4;
  86.    Ping*      = 5;
  87.    LockCfg*   = 6;
  88.    UnlockCfg* = 7;
  89.  
  90.    (* enumeration of fields in an UMS-message *)
  91.  
  92.    msgText*         =   0;
  93.    fromName*        =   1;
  94.    fromAddr*        =   2;
  95.    toName*          =   3;
  96.    toAddr*          =   4;
  97.    msgID*           =   5;
  98.    creationDate*    =   6;
  99.    receiveDate*     =   7;
  100.    refID*           =   8;
  101.    group*           =   9;
  102.    subject*         =  10;
  103.    attributes*      =  11;
  104.    comments*        =  12;
  105.    organization*    =  13;
  106.    distribution*    =  14;
  107.    folder*          =  15;
  108.    fidoID*          =  16;
  109.    mausID*          =  17;
  110.    replyGroup*      =  18;
  111.    replyName*       =  19;
  112.    replyAddr*       =  20;
  113.    logicalToName*   =  21;
  114.    logicalToAddr*   =  22;
  115.    fileName*        =  23;
  116.    rfcMsgNum*       =  24;
  117.  
  118.    fidoText*        =  32;
  119.    errorText*       =  33;
  120.    newsreader*      =  34;
  121.    rfcAttr*         =  35;
  122.    ftnAttr*         =  36;
  123.    zerAttr*         =  37;
  124.    mausAttr*        =  38;
  125.  
  126.    tempFileName*    = 127;
  127.  
  128.   (* user status-bits *)
  129.  
  130.   archive*    =  4; (* msg should be archived, don't delete *)
  131.   junk*       =  5; (* negative selection, inheritance suggested *)
  132.   postPoned*  =  6; (* to be read again, (but not now) *)
  133.   selected*   =  7; (* positive selection, inheritance suggested *)
  134.   filtered*   = 15; (* msg has been processed by filter,
  135.                        'selected' and 'junk' have been properly set *)
  136.  
  137.   Old*          =  8; (* user has already read this Message *)
  138.   Read*         =  Old;
  139.   WriteAccess*  =  9; (* user may change or delete this message *)
  140.   ReadAccess*   = 10; (* user may read this message *)
  141.   ViewAccess*   = 11; (* user may read the header of this message *)
  142.   Owner*        = 12; (* user 'owns' (wrote) this message *)
  143.  
  144.   ProtectedUserFlags*= {WriteAccess, ReadAccess, ViewAccess, Owner};
  145.  
  146.   (* global status-bits *)
  147.  
  148.   Deleted*      = 0; (* msg is really deleted *)
  149.   Expired*      = 1; (* msg has expired and may be deleted *)
  150.   Exported*     = 2; (* msg has been exported *)
  151.   Orphan*       = 3; (* msg could not be exported *)
  152.   Link*         = 4; (* within a ring of linked msgs *)
  153.   HardLink*     = 5; (* link is hardLink *)
  154.   Parked*       = 6; (* msg is "parked", i.e. must not (yet) be exported *)
  155.   HasFile*      = 7; (* msg has an attached file (tempFilename) *)
  156.  
  157.   ProtectedGlobalFlags*= {Deleted, Exported, Orphan, Link, HardLink, HasFile};
  158.  
  159. (*** Errors** *)
  160.  
  161. CONST
  162.   ok*               =  0;
  163.   unknown*          =  1;
  164.  
  165.   noSubject*        = 100;
  166.   forbiddenCode*    = 101;
  167.   noWriteAccess*    = 102;
  168.   noReader*         = 103;
  169.   noExporter*       = 104;
  170.   badLink*          = 105;
  171.   noWork*           = 106;
  172.   noSysop*          = 107;
  173.   badChange*        = 108;
  174.   groupForm*        = 109;
  175.   tooBig*           = 110;
  176.   notRunning*       = 111;
  177.   noImportAcc*      = 112;
  178.   noFromName*       = 113;
  179.   noToName*         = 114;
  180.   cfgLocked*        = 115;
  181.   noHardlinks*      = 116;
  182.  
  183.   dupe*             = 200;
  184.   noReadAccess*     = 201;
  185.   noViewAccess*     = 202;
  186.   msgCorrupted*     = 203;
  187.   noHdrSpace*       = 204;
  188.   noSuchMsg*        = 205;
  189.   badName*          = 206;
  190.   badTag*           = 207;
  191.   missingTag*       = 208;
  192.   noSuchUser*       = 209;
  193.   notFound*         = 210;
  194.   autoBounce*       = 211;
  195.   msgDeleted*       = 212;
  196.   noNetAccess*      = 213;
  197.   badPattern*       = 214;
  198.   badVarname*       = 215;
  199.   fsFull*           = 216;
  200.   noMsgMem*         = 217;
  201.   missingIndex*     = 218;
  202.   mxTags*           = 219;
  203.   userExists*       = 220;
  204.   noSuchAlias*      = 221;
  205.   suicide*          = 222;
  206.   exeErr*           = 223;
  207.  
  208.   serverTerminated* = 300;
  209.   cantWrite*        = 301;
  210.   cantRead*         = 302;
  211.   wrongMsgPtr*      = 303;
  212.   serverNotFree*    = 304;
  213.   idCountProb*      = 305;
  214.   noLogin*          = 306;
  215.   wrongServer*      = 307;
  216.   noMem*            = 308;
  217.   wrongTask*        = 309;
  218.  
  219.   tcpError*         = 400;
  220.  
  221.   (* tag-values *)
  222.  
  223.   typeSTRPTR    = 2000H;
  224.   typeVARPAR    = 4000H;
  225.  
  226.  
  227.   (** tags for WriteMsg()* *)
  228.  
  229.   (*  add 'typeVARPAR' for ReadMsg()  *)
  230.   (*  no 'typeVARPAR' for WriteMsg()  *)
  231.  
  232.   tagMsgNum*            =  1 + Utility.user;
  233.  
  234.   tagMsgDate*           =  4 + Utility.user;
  235.                                 (* don't usually use when writing!      *)
  236.                                 (* Using tagMsgDate with WriteMsg()     *)
  237.                                 (* has a very special meaning.          *)
  238.   tagChainUp*           =  7 + Utility.user;
  239.   tagHardLink*          = 14 + Utility.user;
  240.   tagSoftLink*          = 15 + Utility.user;
  241.   tagMsgCDate*          = 16 + Utility.user;
  242.  
  243.   tagAutoBounce*        = 65 + Utility.user;
  244.                                 (* when writing:                                *)
  245.                                 (* data # 0: server returns error 'autoBounce', *)
  246.                                 (*           but still keeps the Msg and sends  *)
  247.                                 (*           it to the sysops.                  *)
  248.   tagHdrFill*           = 66 + Utility.user;
  249.                                 (* when writing: how much bytes to be reserved  *)
  250.   tagTxtFill*           = 67 + Utility.user;
  251.                                 (*               for header and text            *)
  252.   tagNoUpdate*          = 69 + Utility.user;
  253.                                 (* data = 0: (default) set 'Old'-Flag when      *)
  254.                                 (*           reading or writing                 *)
  255.                                 (* data = 1: don't touch 'Old'-Flag        *)
  256.   tagHide*              = 70 + Utility.user;
  257.                                 (* for writing:                                 *)
  258.                                 (* data = 0: default                            *)
  259.                                 (* data = 1: msg only accessible by exporters   *)
  260.                                 (* data = 2: msg only accessible by users       *)
  261.   tagCheckHeader*       = 71 + Utility.user;
  262.                                 (* data = 0: default                            *)
  263.                                 (* data = 1: don't write msg, only check access    *)
  264.  
  265.   tagMsgText*           = 256 + typeSTRPTR + Utility.user;
  266.   tagFromName*          = tagMsgText + fromName;
  267.   tagFromAddr*          = tagMsgText + fromAddr;
  268.   tagToName*            = tagMsgText + toName;
  269.   tagToAddr*            = tagMsgText + toAddr;
  270.   tagMsgID*             = tagMsgText + msgID;
  271.   tagCreationDate*      = tagMsgText + creationDate;
  272.   tagReceiveDate*       = tagMsgText + receiveDate;
  273.   tagRefID*             = tagMsgText + refID;
  274.   tagGroup*             = tagMsgText + group;
  275.   tagSubject*           = tagMsgText + subject;
  276.   tagAttributes*        = tagMsgText + attributes;
  277.   tagComments*          = tagMsgText + comments;
  278.   tagOrganization*      = tagMsgText + organization;
  279.   tagDistribution*      = tagMsgText + distribution;
  280.   tagFolder*            = tagMsgText + folder;
  281.   tagFidoID*            = tagMsgText + fidoID;
  282.   tagMausID*            = tagMsgText + mausID;
  283.   tagReplyGroup*        = tagMsgText + replyGroup;
  284.   tagReplyName*         = tagMsgText + replyName;
  285.   tagReplyAddr*         = tagMsgText + replyAddr;
  286.   tagLogicalToName*     = tagMsgText + logicalToName;
  287.   tagLogicalToAddr*     = tagMsgText + logicalToAddr;
  288.   tagFileName*          = tagMsgText + fileName;
  289.   tagRFCMsgNum*         = tagMsgText + rfcMsgNum;
  290.  
  291.   tagFidoText*          = tagMsgText + fidoText;
  292.   tagErrorText*         = tagMsgText + errorText;
  293.   tagNewsreader*        = tagMsgText + newsreader;
  294.  
  295.   tagRfcAttr*           = tagMsgText + rfcAttr;
  296.   tagFtnAttr*           = tagMsgText + ftnAttr;
  297.   tagZerAttr*           = tagMsgText + zerAttr;
  298.   tagMausAttr*          = tagMsgText + mausAttr;
  299.  
  300.   tagTempFileName*      = tagMsgText + tempFileName;
  301.  
  302.   tagTextFields*        = 513 + Utility.user;
  303.                                 (* datatype: POINTER TO MsgTextFields *)
  304.  
  305.  
  306.   (** tags for ReadMsg()* *)
  307.  
  308.   (*  add 'typeVARPAR' for ReadMsg()  *)
  309.   (*  no 'typeVARPAR' for WriteMsg()  *)
  310.  
  311.   tagRMsgNum*           =  1 + Utility.user;
  312.  
  313.   tagRHdrLength*        =  2 + Utility.user + typeVARPAR;
  314.   tagRTxtLength*        =  3 + Utility.user + typeVARPAR;
  315.   tagRMsgDate*          =  4 + Utility.user + typeVARPAR;
  316.   tagRChainUp*          =  7 + Utility.user + typeVARPAR;
  317.   tagRChainDn*          =  8 + Utility.user + typeVARPAR;
  318.   tagRChainLt*          =  9 + Utility.user + typeVARPAR;
  319.   tagRChainRt*          = 10 + Utility.user + typeVARPAR;
  320.   tagRGlobalFlags*      = 11 + Utility.user + typeVARPAR;
  321.   tagRUserFlags*        = 12 + Utility.user + typeVARPAR;
  322.   tagRLoginFlags*       = 13 + Utility.user + typeVARPAR;
  323.   tagRHardLink*         = 14 + Utility.user + typeVARPAR;
  324.   tagRSoftLink*         = 15 + Utility.user + typeVARPAR;
  325.   tagRMsgCDate*         = 16 + Utility.user + typeVARPAR;
  326.  
  327.   tagRDateStyle*        = 64 + Utility.user;
  328.                                 (* style for receiveDate when reading:          *)
  329.                                 (* data = 0: no receiveDate                     *)
  330.                                 (* data = 1: emulate old-style receiveDate      *)
  331.   tagRIDStyle*          = 68 + Utility.user;
  332.                                 (* style for Message-ID                         *)
  333.                                 (* data = 0: real Message-ID                    *)
  334.                                 (* data = 1: old style dec-number               *)
  335.   tagRNoUpdate*         = 69 + Utility.user;
  336.                                 (* data = 0: (default) set 'Old'-Flag when      *)
  337.                                 (*           reading or writing                 *)
  338.                                 (* data = 1: don't touch 'Old'-Flag        *)
  339.  
  340.   tagRMsgText*          = 256 + typeSTRPTR + typeVARPAR + Utility.user;
  341.   tagRFromName*         = tagRMsgText + fromName;
  342.   tagRFromAddr*         = tagRMsgText + fromAddr;
  343.   tagRToName*           = tagRMsgText + toName;
  344.   tagRToAddr*           = tagRMsgText + toAddr;
  345.   tagRMsgID*            = tagRMsgText + msgID;
  346.   tagRCreationDate*     = tagRMsgText + creationDate;
  347.   tagRReceiveDate*      = tagRMsgText + receiveDate;
  348.   tagRRefID*            = tagRMsgText + refID;
  349.   tagRGroup*            = tagRMsgText + group;
  350.   tagRSubject*          = tagRMsgText + subject;
  351.   tagRAttributes*       = tagRMsgText + attributes;
  352.   tagRComments*         = tagRMsgText + comments;
  353.   tagROrganization*     = tagRMsgText + organization;
  354.   tagRDistribution*     = tagRMsgText + distribution;
  355.   tagRFolder*           = tagRMsgText + folder;
  356.   tagRFidoID*           = tagRMsgText + fidoID;
  357.   tagRMausID*           = tagRMsgText + mausID;
  358.   tagRReplyGroup*       = tagRMsgText + replyGroup;
  359.   tagRReplyName*        = tagRMsgText + replyName;
  360.   tagRReplyAddr*        = tagRMsgText + replyAddr;
  361.   tagRLogicalToName*    = tagRMsgText + logicalToName;
  362.   tagRLogicalToAddr*    = tagRMsgText + logicalToAddr;
  363.   tagRFileName*         = tagRMsgText + fileName;
  364.   tagRRFCMsgNum*        = tagRMsgText + rfcMsgNum;
  365.  
  366.   tagRFidoText*         = tagRMsgText + fidoText;
  367.   tagRErrorText*        = tagRMsgText + errorText;
  368.   tagRNewsreader*       = tagRMsgText + newsreader;
  369.  
  370.   tagRRfcAttr*          = tagRMsgText + rfcAttr;
  371.   tagRFtnAttr*          = tagRMsgText + ftnAttr;
  372.   tagRZerAttr*          = tagRMsgText + zerAttr;
  373.   tagRMausAttr*         = tagRMsgText + mausAttr;
  374.  
  375.   tagRTempFileName*     = tagRMsgText + tempFileName;
  376.  
  377.   tagRMsgInfo*          = 512 + Utility.user;
  378.                                 (* datatype: POINTER TO MessageInfo (excludes cDate) *)
  379.   tagRTextFields*       = tagRMsgInfo + 1;
  380.                                 (* datatype: POINTER TO MsgTextFields *)
  381.  
  382.   tagRReadHeader*       = tagRMsgInfo + 2;
  383.                                 (* read all header-fields *)
  384.   tagRReadAll*          = tagRMsgInfo + 3;
  385.                                 (* read all text-fields *)
  386.   tagRExtMsgInfo*       = tagRMsgInfo + 4;
  387.                                 (* datatype: POINTER TO MessageInfo *)
  388.  
  389.   (** tags for Select()*  *)
  390.  
  391.   tagSelSet*            = 1024 + Utility.user;
  392.                                 (* flags to set on selected msgs *)
  393.   tagSelUnset*          = tagSelSet + 1;
  394.                                 (* flags to clear *)
  395.   tagSelWriteGlobal*    = tagSelSet + 2;
  396.                                 (* change global flags, not user-flags *)
  397.   tagSelWriteLocal*     = tagSelSet + 3;
  398.                                 (* change login-local flags, not user-flags *)
  399.   tagSelWriteUser*      = tagSelSet + 4 + typeSTRPTR;
  400.                                 (* change other user's flags *)
  401.  
  402.   tagSelStart*        = tagSelSet + 8;
  403.                 (* first msg to process *)
  404.   tagSelStop*        = tagSelSet + 9;
  405.                 (* msg to processing before  *)
  406.  
  407.   (* the following are mutual-exclusiv *)
  408.   (*   use only one of the following operations,   *)
  409.   (*   otherwise unpredictable things may happen!  *)
  410.  
  411.   tagSelReadGlobal*     = tagSelSet + 10;
  412.                                 (* examine global flags, not user-flags *)
  413.   tagSelReadLocal*      = tagSelSet + 11;
  414.                                 (* examine login-local flags, not user-flags *)
  415.   tagSelReadUser*       = tagSelSet + 12 + typeSTRPTR;
  416.                                 (* examine other user's flags *)
  417.   tagSelMask*           = tagSelSet + 16;
  418.                                 (* select msgs, that's flags    *)
  419.   tagSelMatch*          = tagSelSet + 17;
  420.                                 (*   ANDed with mask equal match *)
  421.   tagSelParent*         = tagSelSet + 18;
  422.                                 (* examine parent's flags *)
  423.  
  424.   tagSelDate*           = tagSelSet + 19;
  425.                                 (* select msgs younger than this date *)
  426.  
  427.   tagSelTree*           = tagSelSet + 20;
  428.                                 (* select whole tree this msg is in *)
  429.  
  430.   tagSelSubTree*        = tagSelSet + 21;
  431.                                 (* select sub-tree this msg is root of *)
  432.  
  433.   tagSelMsg*            = tagSelSet + 22;
  434.                                 (* select a msg specified by number *)
  435.  
  436.   tagSelQuick*          = tagSelSet + 23;
  437.                                 (* quick select enabled *)
  438.  
  439.   tagSelLink*           = tagSelSet + 24;
  440.                                  (* 0 don't select links *)
  441.                                  (* 1 also select hard links *)
  442.  
  443.   tagSelCDate*          = tagSelSet + 25;
  444.                                  (* select msgs younger than this cDate *)
  445.  
  446.   tagSelSize*           = tagSelSet + 26;
  447.                                  (* select msgs with more bytes *)
  448.  
  449.   (* more modifiers for status-selects *)
  450.  
  451.   tagSelMaxCount*       = tagSelSet + 27;
  452.                                  (* select at most N msgs *)
  453.                                  (* (backwards)           *)
  454.   tagSelMaxSize*       = tagSelSet + 28;
  455.                                  (* sum up msgs' sizes and stop    *)
  456.                                  (* before the sum exceeds N bytes *)
  457.                                  (* (backwards)                    *)
  458.  
  459.  
  460.   (** tags for Search()* *)
  461.  
  462.   tagSearchLast*        = 2048 + Utility.user;
  463.                                 (* number of LAST msg not to search *)
  464.   tagSearchQuick*       = tagSearchLast + 1;
  465.                                 (* quick searches enabled *)
  466.  
  467.   tagSearchGlobal*      = tagSearchLast + 2;
  468.                                 (* examine global flags instead of user-flags*)
  469.   tagSearchLocal*       = tagSearchLast + 3;
  470.                                 (* examine login-local flags, not user-flags *)
  471.   tagSearchUser*        = tagSearchLast + 4 + typeSTRPTR;
  472.                                 (* examine other user's flags *)
  473.   tagSearchDirection*   = tagSearchLast + 5;
  474.                                 (* set search direction *)
  475.                                 (*  0 = default  *)
  476.                                 (*  1 = forward  *)
  477.                                 (* -1 = backward *)
  478.   tagSearchPattern*     = tagSearchLast + 6;
  479.                                 (* string in tagMsgText .. tagMsgText+127 is: *)
  480.                                 (* 0: no pattern, just a plain string    *)
  481.                                 (* 1: an AmigaDOS style pattern          *)
  482.                                 (* 2: a pattern, only if it contains     *)
  483.                                 (*    wildcards ('auto-detect patterns') *)
  484.  
  485.   tagSearchMask*        = tagSearchLast + 16;
  486.                                 (* search a msg, that's flags   *)
  487.   tagSearchMatch*       = tagSearchLast + 17;
  488.                                 (*   ANDed with mask equal match *)
  489.  
  490.  
  491.   (**  tags for ReadConfig(), WriteConfig()*  *)
  492.  
  493.   tagCfgGlobalOnly*     = 3072 + Utility.user;
  494.                                 (* read or write only global config,         *)
  495.                                 (* thus must not be combined with tagCfgUser *)
  496.   tagCfgName*           = tagCfgGlobalOnly + 1 + typeSTRPTR;
  497.                                 (* name of config var to read or write       *)
  498.   tagCfgUser*           = tagCfgGlobalOnly + 2 + typeSTRPTR;
  499.                                 (* name of user to read/write locals from/to *)
  500.  
  501.   (**  tags for ReadConfig()*  *)
  502.  
  503.   tagCfgUserName*           = tagCfgGlobalOnly + 3 + typeSTRPTR;
  504.                                (* alias to get realname from                *)
  505.   tagCfgNextVar*            = tagCfgGlobalOnly + 4 + typeSTRPTR;
  506.                                (* get name of next var                      *)
  507.   tagCfgNextAlias*          = tagCfgGlobalOnly + 5 + typeSTRPTR;
  508.                                (* get name of next alias                    *)
  509.   tagCfgNextUser*           = tagCfgGlobalOnly + 6 + typeSTRPTR;
  510.                                (* get name of next user                     *)
  511.   tagCfgNextExporter*       = tagCfgGlobalOnly + 7 + typeSTRPTR;
  512.                                (* get name of next exporter                 *)
  513.   tagCfgNextNetGroup*       = tagCfgGlobalOnly + 8 + typeSTRPTR;
  514.                                (* get name of next netgroup                 *)
  515.   tagCfgNextNetGroupMember* = tagCfgGlobalOnly + 9 + typeSTRPTR;
  516.                                (* get name of next groupmember              *)
  517.   tagCfgLockVar*            = tagCfgGlobalOnly +10;
  518.                                (* 0: no locking                             *)
  519.                                (* 1: lock and read config var               *)
  520.  
  521.   (**  tags for ReadConfig(), WriteConfig()  **)
  522.  
  523.   tagCfgQuoted*             = tagCfgGlobalOnly +11;
  524.                                (* 0: no quoting                             *)
  525.                                (* 1: read/write var in quoted format        *)
  526.                                (*    (as used in "ums.config")              *)
  527.  
  528.   (**  tags for WriteConfig()*  *)
  529.  
  530.   tagCfgDump*           = tagCfgGlobalOnly + 16 + typeSTRPTR;
  531.                                 (* write current settings to a file *)
  532.   tagCfgData*           = tagCfgGlobalOnly + 17 + typeSTRPTR;
  533.                                 (* data to write to specified var   *)
  534.   tagCfgCreateUser*     = tagCfgGlobalOnly + 18 + typeSTRPTR;
  535.                                 (* create a new user                *)
  536.   tagCfgDeleteUser*     = tagCfgGlobalOnly + 19 + typeSTRPTR;
  537.                                 (* delete a user                    *)
  538.   tagCfgCreateAlias*    = tagCfgGlobalOnly + 20 + typeSTRPTR;
  539.                                 (* add an alias to a user           *)
  540.   tagCfgDeleteAlias*    = tagCfgGlobalOnly + 21 + typeSTRPTR;
  541.                                 (* delete an alias                  *)
  542.   tagCfgNetGroup*       = tagCfgGlobalOnly + 22 + typeSTRPTR;
  543.   tagCfgAddNetGroup*    = tagCfgGlobalOnly + 23 + typeSTRPTR;
  544.                                 (* create/add netgroups             *)
  545.   tagCfgDeleteNetGroup* = tagCfgGlobalOnly + 24 + typeSTRPTR;
  546.                                 (* delete a new netgroup            *)
  547.   tagCfgUnlockVar*      = tagCfgGlobalOnly + 25;
  548.                                 (* 0: no locking                    *)
  549.                                 (* 1: unlock and write config var   *)
  550.                                 (* 2: unlock but don't write        *)
  551.   tagCfgLocal*          = tagCfgGlobalOnly + 26;
  552.                                 (* create/delete login-local variable *)
  553.   tagCfgCreateSysop*    = tagCfgGlobalOnly + 27 + typeSTRPTR;
  554.                                 (* create a new sysop               *)
  555.   tagCfgCreateExporter* = tagCfgGlobalOnly + 28 + typeSTRPTR;
  556.                                 (* create a new exporter            *)
  557.  
  558.   (**  tags for MatchConfig()  **)
  559.  
  560.   tagMatchGlobalOnly *    = 4096 + Utility.user;
  561.   tagMatchVarname *    = tagMatchGlobalOnly+ 1 + typeSTRPTR;
  562.   tagMatchUser *    = tagMatchGlobalOnly+ 2 + typeSTRPTR;
  563.   tagMatchString *    = tagMatchGlobalOnly+ 3 + typeSTRPTR;
  564.   tagMatchDefault *    = tagMatchGlobalOnly+ 4;
  565.  
  566.  
  567.   (***  functions ***)
  568.  
  569. PROCEDURE Login*           {base, -30} (user{2}    : ARRAY OF CHAR;
  570.                                         passwd{3}  : ARRAY OF CHAR): Account;
  571.  
  572. PROCEDURE Logout*          {base, -36} (account{2}: Account);
  573.  
  574. PROCEDURE ErrNum*          {base,-120} (account{2}: Account): Error;
  575.  
  576. PROCEDURE ErrTxt*          {base,-126} (account{2}: Account): STRPTR;
  577.  
  578. PROCEDURE DeleteMsg*       {base,-132} (account{2}: Account;
  579.                                         MsgNum{3} : MsgNum): BOOLEAN;
  580.  
  581. (*** V9:** *)
  582.  
  583. PROCEDURE ExportedMsg*     {base,-234} (acc{2}: Account;
  584.                                         num{3}: MsgNum);
  585.  
  586. PROCEDURE CannotExport*    {base,-240} (acc{2}  : Account;
  587.                                         num{3}  : MsgNum;
  588.                                         error{4}: ARRAY OF CHAR): BOOLEAN;
  589.  
  590. PROCEDURE VLog*            {base,-246} (acc{2}   : Account;
  591.                                         level{4} : LONGINT;
  592.                                         format{5}: ARRAY OF CHAR;
  593.                                         args{6}  : ARRAY OF SYSTEM.BYTE);
  594. PROCEDURE Log*             {base,-246} (acc{2}   : Account;
  595.                                         level{4} : LONGINT;
  596.                                         format{5}: ARRAY OF CHAR;
  597.                                         args{6}..: SYSTEM.ADDRESS);
  598.  
  599. PROCEDURE RLogin*          {base,-252} (server{2}: ARRAY OF CHAR;
  600.                                         user{3}  : ARRAY OF CHAR;
  601.                                         passwd{4}: ARRAY OF CHAR): Account;
  602.  
  603. PROCEDURE WriteMsg*        {base,-258} (acc{2}     : Account;
  604.                                         tagItems{3}: ARRAY OF Utility.TagItem): MsgNum;
  605. PROCEDURE WriteMsgTags*    {base,-258} (acc{2}       : Account;
  606.                                         tagItems{3}..: Utility.Tag): MsgNum;
  607.  
  608. PROCEDURE ReadMsg*         {base,-264} (acc{2}     : Account;
  609.                                         tagItems{3}: ARRAY OF Utility.TagItem): BOOLEAN;
  610. PROCEDURE ReadMsgTags*     {base,-264} (acc{2}       : Account;
  611.                                         tagItems{3}..: Utility.Tag): BOOLEAN;
  612.  
  613. PROCEDURE FreeMsg*         {base,-270} (acc{2}   : Account;
  614.                                         msgNum{3}: MsgNum);
  615.  
  616. PROCEDURE Select*          {base,-276} (acc{2}     : Account;
  617.                                         tagItems{3}: ARRAY OF Utility.TagItem): LONGINT;
  618. PROCEDURE SelectTags*      {base,-276} (acc{2}       : Account;
  619.                                         tagItems{3}..: Utility.Tag): LONGINT;
  620.  
  621. PROCEDURE Search*          {base,-282} (acc{2}     : Account;
  622.                                         tagItems{3}: ARRAY OF Utility.TagItem): MsgNum;
  623. PROCEDURE SearchTags*      {base,-282} (acc{2}       : Account;
  624.                                         tagItems{3}..: Utility.Tag): MsgNum;
  625.  
  626. PROCEDURE ReadConfig*      {base,-288} (acc{2}     : Account;
  627.                                         tagItems{3}: ARRAY OF Utility.TagItem): STRPTR;
  628. PROCEDURE ReadConfigTags*  {base,-288} (acc{2}       : Account;
  629.                                         tagItems{3}..: Utility.Tag): STRPTR;
  630.  
  631. PROCEDURE FreeConfig*      {base,-294} (acc{2}: Account;
  632.                                         str{3}: STRPTR);
  633.  
  634. PROCEDURE WriteConfig*     {base,-300} (acc{2}     : Account;
  635.                                         tagItems{3}: ARRAY OF Utility.TagItem): BOOLEAN;
  636. PROCEDURE WriteConfigTags* {base,-300} (acc{2}       : Account;
  637.                                         tagItems{3}..: Utility.Tag): BOOLEAN;
  638.  
  639. (* V11 *)
  640.  
  641. PROCEDURE ServerControl*   {base,-312} (server{2}: ARRAY OF CHAR;
  642.                                         action{3}: LONGINT): Error;
  643.  
  644. PROCEDURE MatchConfig*     {base,-318} (acc{2}     : Account;
  645.                                         tagItems{3}: ARRAY OF Utility.TagItem): BOOLEAN;
  646. PROCEDURE MatchConfigTags* {base,-318} (acc{2}       : Account;
  647.                                         tagItems{3}..: Utility.Tag): BOOLEAN;
  648.  
  649. PROCEDURE ErrTxtFromNum*   {base,-324} (err{2}: Error): STRPTR;
  650.  
  651. PROCEDURE DupAccount*      {base,-330} (acc{2}: Account): Account;
  652.  
  653. BEGIN
  654.   base := Exec.OpenLibrary (libName, libVersion);
  655.   IF base = NIL THEN
  656.     SYSTEM.SETREG (0, Intuition.DisplayAlert (0, "\x00\x64\x14missing ums.library\o\o", 50));
  657.     HALT (20)
  658.   END;
  659. CLOSE
  660.   IF base # NIL THEN Exec.CloseLibrary (base); base := NIL END;
  661. END ums.
  662.